home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Development / Source / Shutdown FX 1.3 Source / Shutdown FX ƒ / sfx wipes ƒ / BoxOut wipe.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-14  |  1.9 KB  |  61 lines  |  [TEXT/KAHL]

  1. /**********************************************************************\
  2.  
  3. File:        BoxOut wipe.c
  4.  
  5. Purpose:    This module handles clearing the screen in a funky
  6.             manner.  See the comments below for more details.
  7.             
  8.  
  9. Shutdown FX -=- graphic effects on shutdown
  10. Copyright (C) 1993 Mark Pilgrim & Dave Blumenthal
  11.  
  12. This program is free software; you can redistribute it and/or modify
  13. it under the terms of the GNU General Public License as published by
  14. the Free Software Foundation; either version 2 of the License, or
  15. (at your option) any later version.
  16.  
  17. This program is distributed in the hope that it will be useful,
  18. but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20. GNU General Public License for more details.
  21.  
  22. You should have received a copy of the GNU General Public License
  23. along with this program in a file named "GNU General Public License".
  24. If not, write to the Free Software Foundation, 675 Mass Ave,
  25. Cambridge, MA 02139, USA.
  26.  
  27. \**********************************************************************/
  28.  
  29. #include "msg timing.h"
  30.  
  31. #define        BOXES    50    /* increase this for a finer grained but more timely effect */
  32. #define CorrectTime 2
  33.  
  34. void BoxOutWipe(Pattern *thePattern, int width, int height);
  35.  
  36. void BoxOutWipe(Pattern *thePattern, int width, int height)
  37. {
  38.     Rect            theRect;
  39.     int                cenx, ceny;
  40.     int                boxnum;
  41.     int                theWindowWidth, theWindowHeight;
  42.     
  43.     cenx = width / 2;
  44.     ceny = height / 2;
  45.     
  46.     for(boxnum = 0; boxnum <= BOXES; boxnum++)
  47.     {
  48.         StartTiming();
  49.         
  50.         /* this is not the most efficient method, but the overhead of the
  51.         multiplies and the redundant copying is hidden by the timing mechanism */
  52.         theRect.left = cenx - ((boxnum * cenx) / BOXES);
  53.         theRect.right = cenx + ((boxnum * cenx) / BOXES);
  54.         theRect.top = ceny - ((boxnum * ceny) / BOXES);
  55.         theRect.bottom = ceny + ((boxnum * ceny) / BOXES);
  56.         
  57.         FillRect(&theRect, *thePattern);
  58.         
  59.         TimeCorrection(CorrectTime);
  60.     }
  61. }